import 'dart:io';

import 'package:deer/util/utils.dart';
import 'package:deer/widgets/highlight_well.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class SelectedImage extends StatelessWidget {
  const SelectedImage({
    Key key,
    this.size: 80,
    this.onTap,
    this.image,
  });

  final double size;
  final GestureTapCallback onTap;
  final File image;

  @override
  Widget build(BuildContext context) {
    return HighLightWell(
      borderRadius: BorderRadius.circular(16),
      onTap: onTap,
      child: Container(
        width: size,
        height: size,
        decoration: BoxDecoration(
            //圆角
            borderRadius: BorderRadius.circular(16),
            image: DecorationImage(
              image: image == null
                  ? AssetImage(Utils.getImagePath('store/icon_zj'))
                  : FileImage(image),
              fit: BoxFit.cover
            )),
      ),
    );
  }
}
